package com.zyl.Ecs.common.domain.device.ext;

import com.baomidou.mybatisplus.annotation.TableName;
import com.zyl.Ecs.common.domain.device.bean.Room;
import com.zyl.Ecs.common.domain.device.vo.RoomVO;
import com.zyl.Ecs.common.utils.CUtil;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

/**
 * @version v1.0
 * @ProjectName: Ecs
 * @Package: com.zyl.Ecs.device.domain.ext
 * @ClassName: RoomExt
 * @Description TODO (房间扩展类)
 * @Author 翟玉龙
 * @Date 2024/12/5-9:33
 */
@Data
@SuperBuilder
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName(value = "ecs_room")
public class RoomExt extends Room {

    public static RoomExt toExt(Room room) {
        return CUtil.copyBean(room, RoomExt.class);
    }

    public static RoomExt toExt(RoomVO roomVO) {
        return RoomExt.builder()
                .id(roomVO.getId())
                .name(roomVO.getName())
                .build();
    }
}
